package com.amit;

import java.io.IOException;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class ShowCartServlet extends HttpServlet{
	
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		HttpSession session=request.getSession();
		Enumeration<String> e=session.getAttributeNames();
		List<String> list=Collections.list(e);
		list.remove("BOOKS");
		request.setAttribute("CART", list);
		
		RequestDispatcher rd=request.getRequestDispatcher("showcart.jsp");
		rd.forward(request, response);
		
		
		
		
	}

}
